package com.ld.control.business.process.vo.internal;

import com.ld.control.business.process.model.ProcessNodeParamExampleModel;
import com.ld.control.business.process.vo.internal.node.TransferParamInfo;
import lombok.Data;

import java.util.List;
import java.util.Map;

@Data
public class LoopInSampleNodeParamInfo {

    private Long robotEquipmentId;//机器人id
    private Long robotMethodTmpId;//机器人方法id

    private Long targetEquipmentId;//上样设备id
    private Long targetEquipmentMethodTmpId;//上样设备id

    private String scanDistance;//扫码器位置
    private String scanPoint;//扫码器点位
    private String scanInitPoint;//扫码器安全点位

    ////////////////////////样品暂存架///////////////////////
    private String tmpStackDistance;//样品暂存架位置
    private String tmpStackPointPick;//样品暂存架点位(拿)
    private String tmpStackPointPickInit;//样品暂存架安全点位(拿)
    private String tmpStackPointPlace;//样品暂存架点位(放)
    private String tmpStackPointPlaceInit;//样品暂存架安全点位(放)
    private String tmpSamplePoint;//样品孔位点位
    private String tmpSampleInitPoint;//样品孔位安全点位

    private String sampleJaw;//样品夹爪距离
    private String shelfJaw;//样品架子夹爪距离

    ////////////////////////样品柜///////////////////////////
    private String homeStackDistance;//样品柜位置
    private String homeShelfPointInitPick;//样品柜拿安全点位(拿)
    private String homeShelfPointInitPlace;//样品柜拿安全点位(放)
    //样品柜点位[1001-1101, 1002-1102]拿点位-放点位
    private String[] homeShelfPointArray;

    ////////////////////////样品回收柜///////////////////////////
    private String recoveryShelfDistance;
    private Integer recoveryShelfPointInitPick;
    private Integer recoveryShelfPointInitPlace;
    // 样品回收柜点位[1001-1101, 1002-1102]  拿点位-放点位
    private List<String> recoveryShelfPointArray;


    //////////////////Transfer参数/////////////////////////
    private TransferParamInfo transferParamInfo;

    //taskStackPointArray_1
    //从数组变量里面获取数据[1101-9001-8001,   1102-9002-8002]
    //********************************************
    // 当前任务样品数(任务变量)
    private Integer taskSampleSize;
    // 任务样品剩余数(任务变量)
    private Integer taskSampleRemainSize;
    // 当前子任务样品数(子任务变量)
    private Integer subTaskSampleSize;
    // 当前样品暂存架架拿取位置1-12(任务变量)
    private Integer currentTaskTmpSampleShelfLocation;
    // 子任务样品盘转动以及转动后的点位[1-1001,2-1001,3-1002](子任务前段传过来的变量)
    private List<String> subTaskRotateArray;
    // 样品暂存架可放样品的总数
    private Integer tmpSampleShelfTotal = 12;

    // 样品暂存架12个点位信息[1001,1002,1003....]目前是固定12个
    private List<String> tmpShelfSamplePointArray;


    /////////////////////////////////////////
    ////////////////系统内部赋值用////////////
    private Long subTaskExampleId;
    private Long taskExampleId;
    private String sourceNodeId;
    private Integer targetEquipmentDistance;//设备位置
    private String targetEquipmentPoint;//设备点位
    private String targetEquipmentInitPoint;//设备安全点位


    public static LoopInSampleNodeParamInfo generateLoopInSampleNodeParamInfo(Map<String, ProcessNodeParamExampleModel> processNodeParam) {

        LoopInSampleNodeParamInfo loopInSampleNodeParamInfo = new LoopInSampleNodeParamInfo();
        Long robotEquipmentId = Long.valueOf(processNodeParam.get("robotEquipmentId").getValue());
        Long robotMethodTmpId = Long.valueOf(processNodeParam.get("robotMethodTmpId").getValue());
        Long targetEquipmentId = Long.valueOf(processNodeParam.get("targetEquipmentId").getValue());
        Long targetEquipmentMethodTmpId = Long.valueOf(processNodeParam.get("targetEquipmentMethodTmpId").getValue());
        String scanDistance = processNodeParam.get("scanDistance").getValue();
        String scanPoint = processNodeParam.get("scanDistance").getValue();
        String scanInitPoint = processNodeParam.get("scanInitPoint").getValue();

        String tmpStackDistance = processNodeParam.get("tmpStackDistance").getValue();
        String tmpStackPointPick = processNodeParam.get("tmpStackPointPick").getValue();
        String tmpStackPointPickInit = processNodeParam.get("tmpStackPointPickInit").getValue();
        String tmpStackPointPlace = processNodeParam.get("tmpStackPointPlace").getValue();
        String tmpStackPointPlaceInit = processNodeParam.get("tmpStackPointPlaceInit").getValue();
        String tmpSamplePoint = processNodeParam.get("tmpSamplePoint").getValue();
        String tmpSampleInitPoint = processNodeParam.get("tmpSampleInitPoint").getValue();

        String sampleJaw = processNodeParam.get("sampleJaw").getValue();
        String shelfJaw = processNodeParam.get("shelfJaw").getValue();

        loopInSampleNodeParamInfo.setRobotEquipmentId(robotEquipmentId);
        loopInSampleNodeParamInfo.setRobotMethodTmpId(robotMethodTmpId);
        loopInSampleNodeParamInfo.setTargetEquipmentId(targetEquipmentId);
        loopInSampleNodeParamInfo.setTargetEquipmentMethodTmpId(targetEquipmentMethodTmpId);
        loopInSampleNodeParamInfo.setScanDistance(scanDistance);
        loopInSampleNodeParamInfo.setScanDistance(scanPoint);
        loopInSampleNodeParamInfo.setScanInitPoint(scanInitPoint);

        loopInSampleNodeParamInfo.setTmpStackDistance(tmpStackDistance);
        loopInSampleNodeParamInfo.setTmpStackPointPick(tmpStackPointPick);
        loopInSampleNodeParamInfo.setTmpStackPointPickInit(tmpStackPointPickInit);
        loopInSampleNodeParamInfo.setTmpStackPointPlace(tmpStackPointPlace);
        loopInSampleNodeParamInfo.setTmpStackPointPlaceInit(tmpStackPointPlaceInit);
        loopInSampleNodeParamInfo.setTmpSamplePoint(tmpSamplePoint);
        loopInSampleNodeParamInfo.setTmpSampleInitPoint(tmpSampleInitPoint);

        loopInSampleNodeParamInfo.setSampleJaw(sampleJaw);
        loopInSampleNodeParamInfo.setShelfJaw(shelfJaw);

        return loopInSampleNodeParamInfo;
    }

}
